/*
 * HttpResponse.h
 *
 *  Created on: Mar 14, 2012
 *      Author: shaohong
 */

#ifndef HTTPRESPONSE_H_
#define HTTPRESPONSE_H_

#include <string>
#include <vector>

using namespace std;

// data structure representing an HTTP response (non streaming version)

class HttpResponse {
public:
	HttpResponse();
	virtual ~HttpResponse();


	string generateHeadersStrings();

	void setStatus(int statusCode, string reasonPhrase);

	string getStatus();
	int getStatusCode();
    int getContentLength() const;
    void setContentLength(int contentLength);

    // generate error page based on the status
    string generateErrorPage();


	char * data;

	int statusCode;
	string reasonPhrase;
	int contentLength;

	vector<string> additionalHeaders;	// additional headers in the response;

};

#endif /* HTTPRESPONSE_H_ */
